package com.itawei.d3_io;

import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;

/**
 * FileInputStream:字节输入流
 */
public class ByteStreamDemo5 {
    public static void main(String[] args) throws IOException {
        /*
            字节输入流循环读取
         */
        //1.创建对象
        FileInputStream fis = new FileInputStream("day06-file-io\\a.txt");
        //2.while循环读取数据
        int b;//为了防止调用一次read()方法就 移动指针
        while((b = fis.read()) != -1){
            System.out.println((char)b);
        }
        //3.释放数据
        fis.close();

    }
}
